package practice10;


import java.util.ArrayList;
import java.util.List;

public class Klass {
    private int number;
    private Student leader;
    List<String> list=new ArrayList();
    public String assignLeader(Student student) {
        boolean b=false;

        for (String s:list){
            if (s==student.getName()){
                b=true;
            }
        }
        if (b==true){
            leader = student;
            return leader.introduce();
        }else {
            System.out.println("It is not one of us.");
            return null;
        }
    }

    public List appendMember(Student student){

        list.add(student.getName());
        return list;
    }

    public String getDisplayName() {
        return "Class " + number;
    }

    public Student getLeader() {
        return leader;
    }

    public void setLeader(Student leader) {
        this.leader = leader;
    }

    public Klass(int number) {
        this.number = number;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }
}
